import Vue from "vue";
import VueRouter from "vue-router";
import Home from '../pages/Home'
import Login from '../pages/Login'
import Music from '../pages/Home/Music'
import News from '../pages/Home/News'
import Games from '../pages/Home/Games'
Vue.use(VueRouter)

export default new VueRouter({
    routes:[
        {
            path:'/home',
            component:Home,
            children:[
                {path:'music/:id/:time?',component:Music,name:'music',props:true},
                {path:'news',component:News,name:'news'},
                {path:'games',component:Games,name:'games',props:(route) => {
                    return route.query
                }},
                {path:'/',redirect:'/home/news'}
            ]
        },
        {path:'/login',component:Login},
        {path:'/',redirect:'/home'}
    ]
})